package com.etime.perfectschool.service.impl;

import com.etime.perfectschool.mapper.ActivitiesPhotoMapper;
import com.etime.perfectschool.mapper.FoodCommentsMapper;
import com.etime.perfectschool.pojo.ActivitiesPhoto;
import com.etime.perfectschool.service.ActivitiesPhotoService;
import com.etime.perfectschool.service.FoodCommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivitiesPhotoServiceImpl implements ActivitiesPhotoService {

    @Autowired
    private ActivitiesPhotoMapper activitiesPhotoMapper;

    @Override
    public int insertActivitiesPhoto(ActivitiesPhoto activitiesPhoto) {
        return activitiesPhotoMapper.insert(activitiesPhoto);
    }

    @Override
    public List<ActivitiesPhoto> getAllActivitiesPhotoByactivityId(int activityId) {
        return activitiesPhotoMapper.getAllActivitiesPhotoByactivityId(activityId);
    }

    @Override
    public boolean deleteActivitiesPhotoById(int activityId) {
        return activitiesPhotoMapper.deleteActivitiesPhotoById(activityId)==0?false:true;
    }

    @Override
    public boolean updateActivitiesPhoto(ActivitiesPhoto activitiesPhoto) {
        return activitiesPhotoMapper.updateById(activitiesPhoto)==0?false:true;
    }
}
